export const rnUtil = {
  login() {
    window.onLogin = userInfo => {
      console.log(userInfo)
    }
    const data = {
      action: 'login',
      callback: 'onLogin'
    }
    window.ReactNativeWebView.postMessage(JSON.stringify(data))
  },

  getToken() {
    window.getToken = userInfo => {
      console.log(userInfo)
    }
    const data = {
      action: 'login',
      callback: 'onLogin'
    }
    window.ReactNativeWebView.postMessage(JSON.stringify(data))
  }
}
